package com.dyh.quickdemozwei.pipe0428;





import java.util.ArrayList;
import java.util.List;


public class PipeUnitObject<I> {

    PipeUnit<I> pipeUnit;

    List<PipeUnitPlugin> plugins;

    private PipeUnitObject(PipeUnit<I> pipeUnit) {
        this.pipeUnit = pipeUnit;
    }

    public static <I> PipeUnitObject<I> from(PipeUnit<I> pipeUnit){
        return new PipeUnitObject<>(pipeUnit);
    }



    public void addPlugins(PipeUnitPlugin plugin){
        if (plugins==null){
            this.plugins = new ArrayList<>();
        }
        this.plugins.add(plugin);
    }

    public List<PipeUnitPlugin> getPlugins() {
        return plugins;
    }

    public void setPlugins(List<PipeUnitPlugin> plugins) {
        this.plugins = plugins;
    }

    public PipeUnit<I> getPipeUnit() {
        return pipeUnit;
    }
}
